package study.java.jdk.jdk8._1_stream.terminal;

import lombok.extern.slf4j.Slf4j;
import org.junit.Test;

import java.util.Arrays;
import java.util.Comparator;
import java.util.List;
import java.util.Optional;

@Slf4j
public class max_Test {

    private List<String> src = Arrays.asList("1", "2", "3", "4", "5");

    /**
     * @param comparator Comparator
     */
    @Test
    public void test() {
        Optional<String> max = src.stream()
                .max(Comparator.naturalOrder());
        log.info("max= {}", max.get());
    }
}
